package com.rf.richfitwheel.common.errors;

/**
 * @Author Wen Shaokun
 * @Description
 * @Created 2022/02/16 - 13:59
 */
public interface Code {
    enum General {
        /**
         * 成功，HTTP Status 统一返回200
         * code 统一返回0
         */
        @C(0) SUCCESS,
        @C(value = -1, msg = "unknown error") UNKNOWN_ERROR
    }

    @CodePrefix("2")
    enum Auth {
        /**
         * 鉴权相关错误
         */
        @C(value = 101, msg = "当前登录用户对目标数据无操作权限") NO_OP_PERMIT,
        @C(value = 102, msg = "用户未登录") NON_LOGGED
    }

    @CodePrefix("3")
    enum Business {
        /**
         * 业务相关错误
         */
        @C(value = 101, msg = "传入机构编码orgCode格式错误") ORG_CODE_FORMAT_ERROR,
        @C(value = 102, msg = "机构编码orgCode入参为空") ORG_CODE_NULL_ERROR,
        @C(value = 103, msg = "会计科目account入参为空") ACCOUNT_NULL_ERROR,
        @C(value = 403, msg = "Excel格式错误，文件读取失败") XLSX_FORMAT_ERR
    }

    @CodePrefix("4")
    enum Client {
        /**
         * 客户端相关错误
         */
        @C(value = 401, msg = "入参ID不存在") ID_NOT_EXISTED,
        @C(value = 402, msg = "入参IDs字段不存在或为空") IDS_NOT_EXISTED,
        @C(value = 403, msg = "入参对象集合为空") COLLECTION_IS_NULL,
        @C(value = 404, msg = "解析对象属性全部为空，无法赋值") FIELDS_ALL_NULL,
        @C(value = 405, msg = "开始时间已存在评级标准记录") DATE_SHOULD_GREATER_THAN_ENDDATE,
        @C(value = 406, msg = "解析Excel文件出错") XSL_PARSE_ERROR,
        @C(value = 407, msg = "Excel数据有误，请检查数据格式以及内容") XSL_VALIDATION_ERROR,
        @C(value = 409, msg = "上传文件为空") UPLOAD_FILE_EMPTY_ERR
    }

    @CodePrefix("7")
    enum Database {
        /**
         * 数据库相关错误
         */
        @C(value = 211, msg = "没有关联的客户风险状态") QUERY_RISK_CUSTOMER_NO_RESULT,
        @C(value = 212, msg = "没有关联的关注客户信息") QUERY_NO_CONCERN_CUSTOMER,
        @C(value = 213, msg = "无系统监控结果信息") QUERY_NO_SYS_MONITOR_RESULT,
        @C(value = 214, msg = "符合该条件的数据已存在，请勿重复操作") QUERY_DATA_EXISTS,
        @C(value = 215, msg = "erpCode编码为空") QUERY_ERPCODE_NO_RESULT,
        @C(value = 216, msg = "您单位暂未配置评级方式!") QUERY_RATING_TYPE_ERROR,
        @C(value = 217, msg = "您单位还未录入自评级等级！") QUERY_TARGET_GRADES_ERROR,
        @C(value = 218, msg = "您单位还未录入自评级等级！") QUERY_SUPPLIER_RATING_ITEMS_ERROR,
        @C(value = 298, msg = "无法查询到输入的客户基础信息") QUERY_ENTERPRISE_INFO_NO_RESULT,
        @C(value = 301, msg = "关注客户已全部关联，请勿重复添加") INSERT_CONCERN_CUSTOMER_DUPLICATE,
        @C(value = 302, msg = "新增指标失败，指标类型和条件已存在") INSERT_PRECAUTION_TYPE_DUPLICATE,
        @C(value = 303, msg = "新增预警等级失败, indicatorcode无法创建") INSERT_PRECAUTION_INDICATOR_CODE_FAIL,
        @C(value = 304, msg = "新增预警条件失败， 该指标已存在") INSERT_PRECAUTION_CONDITION_DUPLICATE,
        @C(value = 305, msg = "新增预警条件失败, indicatorcode无法创建") INSERT_PRECAUTION_CONDITION_CODE_FAIL,
        @C(value = 306, msg = "新增指标失败, 预警级别和条件已存在") INSERT_PRECAUTION_INDICATOR_DUPLICATE,
        @C(value = 307, msg = "预关注客户已存在于关注列表，请勿重复关注") INSERT_CHOSEN_CUSTOMER_DUPLICATE,
        @C(value = 311, msg = "新增风险等级失败，指标已存在") INSERT_RISK_LEVEL_DUPLICATE,
        @C(value = 312, msg = "新增资产负债表条目失败") INSERT_ASSET_LIABILITIES_ERROR,
        @C(value = 313, msg = "新增利润表条目失败") INSERT_PROFIT_ERROR,
        @C(value = 314, msg = "新增现金流量表条目失败") INSERT_CASH_FLOW_ERROR,
        @C(value = 315, msg = "新增客户综合印象录入条目失败") INSERT_CUST_IMPRESS_ERROR,
        @C(value = 316, msg = "新增交易额总额条目失败") INSERT_ORDER_AMOUNT_ERROR,
        @C(value = 317, msg = "更新交易额总额条目失败") UPDATE_ORDER_AMOUNT_ERROR,
        @C(value = 318, msg = "新增信用评级录入条目失败") INSERT_CREDIT_SUGGEST_ERROR,
        @C(value = 319, msg = "新增供应商系统评级扣分项失败") INSERT_SUPPLIER_SCORES_ERROR,
        @C(value = 371, msg = "Webservice: 保存ERP返回信息失败，详情参考错误日志") WS_INSERT_ERP_RETURN_MSG_ERROR,
        @C(value = 372, msg = "Webservice: 同步客户基础信息失败，详情参考错误日志") WS_SYN_CUST_DIC_ERROR,
        @C(value = 381, msg = "新增风险内容失败") INSERT_RISK_DETAIL_ERROR,
        @C(value = 382, msg = "批量插入风险客户部分未成功，操作失败") BATCH_INSERT_CONCERN_CUSTOMER_ERROR,
        @C(value = 383, msg = "批量插入监控结果部分未成功，操作失败") BATCH_INSERT_MONITOR_RESULT_ERROR,
        @C(value = 384, msg = "级联更新失败，关联操作无法完成") UPDATE_CASCADE_INCOMPLETE_FAIL,
        @C(value = 385, msg = "当前单位评级已配置") INSERT_RATING_SET_DUPLICATE,
        @C(value = 386, msg = "查询关联风险客户结果为空或不匹配，新增操作无效") INSERT_RISK_CUSTOMER_INFO_CUST_CHOOSE_ERROR,
        @C(value = 387, msg = "查询关联客商信息为空或不匹配，更新操作无效") UPDATE_RATING_SET_ERROR,
        @C(value = 388, msg = "新增关联风险客户失败，新增操作无效") INSERT_CONCERN_CUSTOMER_ERROR,
        @C(value = 389, msg = "更新关联风险客户失败，更新操作无效") UPSERT_CONCERN_CUSTOMER_ERROR,
        @C(value = 390, msg = "批量更新风险客户部分未成功，操作失败") BATCH_UPSERT_CONCERN_CUSTOMER_ERROR,
        @C(value = 391, msg = "新增客商评级配置失败，详情参考错误日志") INSERT_RATING_SET_SERVER_ERROR,
        @C(value = 392, msg = "新增预警条件失败，详情参考错误日志") UPDATE_PRECAUTION_CONDITION_FAIL_SERVER_ERROR,
        @C(value = 393, msg = "新增客商自评级标准登记失败，详情参考错误日志") INSERT_RATING_ENTITY_SERVER_ERROR,
//        @C(value = 395, msg = "新增客户关系失败, ERP同步客户基础信息出错") INSERT_CUST_REL_SYNC_ERROR,
//        @C(value = 396, msg = "新增客户信息失败, ERP同步客户基础信息出错") INSERT_CUST_INFO_SYNC_ERROR,
//        @C(value = 397, msg = "新增客户选用关系失败, ERP同步客户基础信息出错") INSERT_CUST_CHOOSE_SYNC_ERROR,
        @C(value = 394, msg = "新增信用账期配置失败，详情参考错误日志") INSERT_ACCOUNT_PERIOD_SERVER_ERROR,
        @C(value = 395, msg = "更新信用账期配置失败，详情参考错误日志") UPDATE_ACCOUNT_PERIOD_ERROR,
        @C(value = 396, msg = "新增客商自评级等级失败，详情参考错误日志") INSERT_GRADE_ENTITY_SERVER_ERROR,
        @C(value = 397, msg = "更新客商自评级等级失败或不匹配，更新操作无效") UPDATE_GRADE_ENTITY_ERROR,
        @C(value = 398, msg = "更新客商自评级标准登记失败或不存在匹配的标准，更新操作无效") UPDATE_BATCH_GRADE_ENTITY_ERROR,
        @C(value = 399, msg = "批量新增操作失败，详情参考错误日志") BATCH_INSERT_FAIL_SERVER_ERROR,
        @C(value = 400, msg = "批量更新操作失败，详情参考错误日志") BATCH_UPDATE_FAIL_SERVER_ERROR,
        @C(value = 401, msg = "删除操作失败") DELETE_FAIL,
        @C(value = 404, msg = "删除操作失败，待删除内容或不存在") ENTITY_NOT_EXISTED,
        @C(value = 405, msg = "待删除内容不存在或不属于当前机构") ENTITY_NOT_EXISTED_OR_NOT_BELONG,
        @C(value = 406, msg = "批量删除失败") BATCH_DELETE_FAIL,
        @C(value = 407, msg = "批量删除失败，ids字段不存在或为空") BATCH_DELETE_IDS_FAIL,
        @C(value = 408, msg = "批量删除失败，当前账户无操作权限") BATCH_DELETE_FORBIDDEN,
        @C(value = 409, msg = "批量删除失败，关联操作无法完成") BATCH_DELETE_INCOMPLETE_FAIL,
        @C(value = 410, msg = "删除关联风险客户失败，关联操作无法完成") DELETE_RISK_CONCERN_CUSTOMER_FAIL,
        @C(value = 411, msg = "添加供应商评级指标失败") INSERT_SUPPLIER_INDEX_ERROR,

//        @C(value = 490, msg = "删除ERP返回客户关系失败，ERP同步客户基础信息失败") DELETE_CUST_REL_SYNC_ERROR,
        @C(value = 491, msg = "删除失败，详情参考错误日志") DELETE_FAIL_SERVER_ERROR,
        @C(value = 492, msg = "批量删除失败，详情参考错误日志") BATCH_DELETE_FAIL_SERVER_ERROR,
        @C(value = 493, msg = "删除一级供应商评级指标失败") DELETE_TOP_SUPPLIER_INDEX_ERROR,
        @C(value = 494, msg = "删除二级级供应商评级指标失败") DELETE_SEC_SUPPLIER_INDEX_ERROR,
        @C(value = 510, msg = "更新供应商评级指标失败") UPDATE_SUPPLIER_INDEX_ERROR,
        @C(value = 511, msg = "目标对象内容与更新状态一致，更新未完成") UPDATE_FAIL_SAME_STATE,
        @C(value = 501, msg = "数据更新失败，更新对象或不存在") UPDATE_FAIL,
        @C(value = 502, msg = "更新监控指标失败，更新对象或不存在") UPDATE_INDICATOR_FAIL,
        @C(value = 503, msg = "更新系统监控指标失败，编辑指标或已存在，或编辑对象不存在") UPDATE_PRECAUTION_INDICATOR_FAIL,
        @C(value = 504, msg = "更新特定风险内容失败，更新对象或不存在") UPDATE_RISK_DETAIL_FAIL,
        @C(value = 505, msg = "更新关联客户信息失败，更新对象或不存在") UPDATE_RISK_CUSTOMER_FAIL,
        @C(value = 506, msg = "批量更新失败，当前账户无操作权限") BATCH_UPDATE_FORBIDDEN,
        @C(value = 507, msg = "更新预警信息名称失败") UPDATE_INDICATOR_NAME_FAIL,
        @C(value = 508, msg = "更新特定预警内容失败，更新对象或不存在") UPDATE_PRECAUTION_DETAIL_FAIL,
        @C(value = 509, msg = "更新客户信息失败, ERP同步客户基础信息出错") UPDATE_CUST_INFO_SYNC_ERROR,
        @C(value = 591, msg = "更新失败，详情参考错误日志") UPDATE_FAIL_SERVER_ERROR,

        @C(value = 601, msg = "新增台账数据失败，详情参考错误日志") INSERT_LEDGER_DATA_ERR
    }
}
